Skip to content

Add support for metadata.code.branch_hint section #4460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Lukasdoe
Copy link

@Lukasdoe Lukasdoe commented Jul 7, 2025

Since we're currently in the progress of upstreaming the generation of the code metadata branch hint section in llvm (PR), I also implemented support for this feature in wamr.

One important consideration for the implementation was to keep the encoding of hints generic, so that more compilation hints could be added in the future.

@Lukasdoe
Copy link
Author

Lukasdoe commented Jul 7, 2025

(rebased on main)

Copy link
Collaborator

@lum1n0us lum1n0us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any possibility that the interpreter can also benefit from this feature?

@Lukasdoe
Copy link
Author

Alright, the changes from the review are now committed. Thank you very much for taking the time and effort to give such a good review :)

Concerning your question about branch hints and the interpreter:
Since I only looked at the AOT part of this project, I honestly don't know and currently don't have the capacity to test this out. Maybe you know some other maintainer knows the interpreter's codebase well and could judge whether (very simple) knowledge about the probability that a branch is taken / not taken would benefit interpretation.

@lum1n0us lum1n0us added the new feature Determine if this Issue request a new feature or this PR introduces a new feature. label Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Determine if this Issue request a new feature or this PR introduces a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants